<template>
  <div class="app-container">
    <el-row>
      <!-- 第一个大块 start -->
      <el-col :span="8" v-for="(item, index) in this.list " :key="index">
        <div class="widget-panel widget-style-2" v-bind:class="item.class">
          <i class="ion-eye">
            <img v-bind:src="qiNiuPath + prefix + item.field + '.svg'" class="images">
          </i>
          <h2 class="m-0 counter">{{ item.value }}</h2>
          <div>{{ item.title }}</div>
        </div>
      </el-col>
      <!-- 第一个大块 end -->
    </el-row>
  </div>
</template>

<script>
  // import { indexCount } from '@/api/admin'

  export default {
    data() {
      return {
        qiNiuPath: 'http://cdn.bsybx.com/',
        prefix: 'erp/',
        list: [
          { 'title': '充电桩总数', 'field': 'month_new_customer', 'value': 0, 'class': 'bg-info', path: '/customer/customer' },
          { 'title': '会员用户数', 'field': 'month_success_customer', 'value': 0, 'class': 'bg-warning', path: '/customer/customer' },
          { 'title': '工单总数', 'field': 'ready_expire_contract', 'value': 0, 'class': 'bg-success', path: '/task/installDevice' }
        ]
      }
    },
    methods: {
      getCount() {
        // indexCount({}).then(response => {
        //   this.list[0].value = response.orderAddCount
        //   this.list[1].value = response.userCount
        //   this.list[2].value = response.orderSuccessCount
        //   this.list[3].value = response.goodsUpCount
        //   this.list[4].value = response.goodsDownCount
        //   this.list[5].value = response.orderAnZhuang
        // })
      }
    },
    mounted() {
      this.getCount()
    }
  }
</script>
<style rel="stylesheet/scss" lang="scss">
  .emptyGif {
    display: block;
    width: 45%;
    margin: 0 auto;
  }

  .dashboard-editor-container {
    background-color: #fff;
    min-height: 100vh;
    margin-top: -50px;
    padding: 100px 60px 0px;
  }
  .pan-info-roles {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    display: block;
  }
  .info-container {
    position: relative;
    margin-left: 190px;
    height: 150px;
    line-height: 200px;
    .display_name {
      font-size: 48px;
      line-height: 48px;
      color: #212121;
      position: absolute;
      top: 25px;
    }
  }
  .widget-style-2{
    width:90%;
    height:130px;
  }
  .widget-panel {
    padding: 40px 20px;
    border-radius: 4px;
    color: #ffffff;
    position: relative;
    margin-bottom: 20px;
  }
  .m-0 {
    margin: 0px !important;
  }
  .widget-style-2 i {
    height: 130px;
    font-size: 10px;
    float: right;
    margin-top:-40px;
    margin-right: -20px;
    width:40%;
    color: #edf0f0;
    background: rgba(255, 255, 255, 0.2);
  }
  .bg-info{
    background:#20a0ff;
  }
  .bg-success{
    background:#13ce66;
  }
  .bg-danger{
    background:#ff4949;
  }
  .bg-warning{
    background:#f7ba2a;
  }
  .images {
    max-width: 60px;
    max-height: 60px;
    width: 100%;
    height: 100%;
  }
  .ion-eye {
    padding-top: 40px;
    text-align: center;
  }

</style>
